<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Box2D: b2World Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="icon.gif"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Box2D
   &#160;<span id="projectnumber">2.2.1</span>
   </div>
   <div id="projectbrief">A 2D Physics Engine for Games</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#friends">Friends</a>  </div>
  <div class="headertitle">
<div class="title">b2World Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="b2World" -->
<p><code>#include &lt;<a class="el" href="b2_world_8h_source.html">b2World.h</a>&gt;</code></p>

<p><a href="classb2_world-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#aeccc87fd9e36702c821a8244ca7cd875">b2World</a> (const <a class="el" href="structb2_vec2.html">b2Vec2</a> &amp;gravity)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5250ae4487475c33ccefdead07c768c8"></a><!-- doxytag: member="b2World::~b2World" ref="a5250ae4487475c33ccefdead07c768c8" args="()" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a5250ae4487475c33ccefdead07c768c8">~b2World</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Destruct the world. All physics entities are destroyed and all heap memory is released. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#ae377f2dd5512ada7d27f4ad3541c75bf">SetDestructionListener</a> (<a class="el" href="classb2_destruction_listener.html">b2DestructionListener</a> *listener)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a85e6e1e911c7d6366f8c7d57a12b72ff">SetContactFilter</a> (<a class="el" href="classb2_contact_filter.html">b2ContactFilter</a> *filter)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a614549967fb8a1584b61c11e2d553d42">SetContactListener</a> (<a class="el" href="classb2_contact_listener.html">b2ContactListener</a> *listener)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a6976d2c67400df03c0d44174ffcfb7ee">SetDebugDraw</a> (<a class="el" href="classb2_draw.html">b2Draw</a> *debugDraw)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classb2_body.html">b2Body</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a2eb36e967e43294bfa03ec3d177c2dae">CreateBody</a> (const <a class="el" href="structb2_body_def.html">b2BodyDef</a> *def)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#ad52231ad7a9556ef5735ac79cbcd8fcf">DestroyBody</a> (<a class="el" href="classb2_body.html">b2Body</a> *body)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classb2_joint.html">b2Joint</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a5cba9d0653149eb62504154e6fb35021">CreateJoint</a> (const <a class="el" href="structb2_joint_def.html">b2JointDef</a> *def)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#add5942aef171e54cfa384c8975746dca">DestroyJoint</a> (<a class="el" href="classb2_joint.html">b2Joint</a> *joint)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a7a8eff61af98461f978fe43f3af7be90">Step</a> (float32 timeStep, int32 velocityIterations, int32 positionIterations)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#ac082ab4c4ad0b1c5ec4674315eeec643">ClearForces</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a293d9865e407fd463e168b0a29856acc"></a><!-- doxytag: member="b2World::DrawDebugData" ref="a293d9865e407fd463e168b0a29856acc" args="()" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a293d9865e407fd463e168b0a29856acc">DrawDebugData</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Call this to draw shapes and other debug draw data. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a711e55d2c6e68400f93472f807c3775b">QueryAABB</a> (<a class="el" href="classb2_query_callback.html">b2QueryCallback</a> *callback, const <a class="el" href="structb2_a_a_b_b.html">b2AABB</a> &amp;aabb) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#ad902548be84df9cc36eced0f4c89ab0a">RayCast</a> (<a class="el" href="classb2_ray_cast_callback.html">b2RayCastCallback</a> *callback, const <a class="el" href="structb2_vec2.html">b2Vec2</a> &amp;point1, const <a class="el" href="structb2_vec2.html">b2Vec2</a> &amp;point2) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classb2_body.html">b2Body</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a1b87c03955e3312d308ddf679adf3c85">GetBodyList</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab7c43e574c60203db003645153663266"></a><!-- doxytag: member="b2World::GetBodyList" ref="ab7c43e574c60203db003645153663266" args="() const " -->
const <a class="el" href="classb2_body.html">b2Body</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>GetBodyList</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classb2_joint.html">b2Joint</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a55db7240f8290aa02cab79f181934de8">GetJointList</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a966ceb42d968a8a544d60826ce0ed925"></a><!-- doxytag: member="b2World::GetJointList" ref="a966ceb42d968a8a544d60826ce0ed925" args="() const " -->
const <a class="el" href="classb2_joint.html">b2Joint</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>GetJointList</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classb2_contact.html">b2Contact</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#ab1e1c59fd7534c0268c2a3e31370a425">GetContactList</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a15e9281350c0494954197801372e3dbb"></a><!-- doxytag: member="b2World::GetContactList" ref="a15e9281350c0494954197801372e3dbb" args="() const " -->
const <a class="el" href="classb2_contact.html">b2Contact</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>GetContactList</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6755872564fc3db70c69d2b9d349fa33"></a><!-- doxytag: member="b2World::SetAllowSleeping" ref="a6755872564fc3db70c69d2b9d349fa33" args="(bool flag)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a6755872564fc3db70c69d2b9d349fa33">SetAllowSleeping</a> (bool flag)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable/disable sleep. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaf98b836840452d646927ba19a02316f"></a><!-- doxytag: member="b2World::GetAllowSleeping" ref="aaf98b836840452d646927ba19a02316f" args="() const " -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>GetAllowSleeping</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8e8c12142e8c4884a18787926a261359"></a><!-- doxytag: member="b2World::SetWarmStarting" ref="a8e8c12142e8c4884a18787926a261359" args="(bool flag)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a8e8c12142e8c4884a18787926a261359">SetWarmStarting</a> (bool flag)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable/disable warm starting. For testing. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af7679b68ff6bf97d31a6136efaee562e"></a><!-- doxytag: member="b2World::GetWarmStarting" ref="af7679b68ff6bf97d31a6136efaee562e" args="() const " -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>GetWarmStarting</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a536dd9181c2e20096073e3cfe2c8530a"></a><!-- doxytag: member="b2World::SetContinuousPhysics" ref="a536dd9181c2e20096073e3cfe2c8530a" args="(bool flag)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a536dd9181c2e20096073e3cfe2c8530a">SetContinuousPhysics</a> (bool flag)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable/disable continuous physics. For testing. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa11dbc1175a7a458e007722ab7287ff1"></a><!-- doxytag: member="b2World::GetContinuousPhysics" ref="aa11dbc1175a7a458e007722ab7287ff1" args="() const " -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>GetContinuousPhysics</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae8aacc78ea4753075067daff51b61778"></a><!-- doxytag: member="b2World::SetSubStepping" ref="ae8aacc78ea4753075067daff51b61778" args="(bool flag)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#ae8aacc78ea4753075067daff51b61778">SetSubStepping</a> (bool flag)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable/disable single stepped continuous physics. For testing. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae3922f4935ad0dd7f85eea7550e18c5d"></a><!-- doxytag: member="b2World::GetSubStepping" ref="ae3922f4935ad0dd7f85eea7550e18c5d" args="() const " -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>GetSubStepping</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a67f1f9fbdd85abd2100104c5eabe17cb"></a><!-- doxytag: member="b2World::GetProxyCount" ref="a67f1f9fbdd85abd2100104c5eabe17cb" args="() const " -->
int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a67f1f9fbdd85abd2100104c5eabe17cb">GetProxyCount</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the number of broad-phase proxies. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4559122ea51401b4fb7342eb6232ce74"></a><!-- doxytag: member="b2World::GetBodyCount" ref="a4559122ea51401b4fb7342eb6232ce74" args="() const " -->
int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a4559122ea51401b4fb7342eb6232ce74">GetBodyCount</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the number of bodies. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a54a95a98787ed5f383c6549ee1f4c4d5"></a><!-- doxytag: member="b2World::GetJointCount" ref="a54a95a98787ed5f383c6549ee1f4c4d5" args="() const " -->
int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a54a95a98787ed5f383c6549ee1f4c4d5">GetJointCount</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the number of joints. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abcc976f1755f9bb94a8650f5f4219a8d"></a><!-- doxytag: member="b2World::GetContactCount" ref="abcc976f1755f9bb94a8650f5f4219a8d" args="() const " -->
int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#abcc976f1755f9bb94a8650f5f4219a8d">GetContactCount</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the number of contacts (each may have 0 or more contact points). <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a48f90a31dc2ad30dbc50cac5111400d7"></a><!-- doxytag: member="b2World::GetTreeHeight" ref="a48f90a31dc2ad30dbc50cac5111400d7" args="() const " -->
int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a48f90a31dc2ad30dbc50cac5111400d7">GetTreeHeight</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the height of the dynamic tree. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9fb7c28d042b600ba1155e3d38f1c5f9"></a><!-- doxytag: member="b2World::GetTreeBalance" ref="a9fb7c28d042b600ba1155e3d38f1c5f9" args="() const " -->
int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a9fb7c28d042b600ba1155e3d38f1c5f9">GetTreeBalance</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the balance of the dynamic tree. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a0e9dceab7052fd6e0d73d6024cca1bcb">GetTreeQuality</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aeafa43d6580e1dddb0675e672ca2375c"></a><!-- doxytag: member="b2World::SetGravity" ref="aeafa43d6580e1dddb0675e672ca2375c" args="(const b2Vec2 &amp;gravity)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#aeafa43d6580e1dddb0675e672ca2375c">SetGravity</a> (const <a class="el" href="structb2_vec2.html">b2Vec2</a> &amp;gravity)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Change the global gravity vector. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1e34bcd2f75fbdd41e2d84b3eb26d1ab"></a><!-- doxytag: member="b2World::GetGravity" ref="a1e34bcd2f75fbdd41e2d84b3eb26d1ab" args="() const " -->
<a class="el" href="structb2_vec2.html">b2Vec2</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a1e34bcd2f75fbdd41e2d84b3eb26d1ab">GetGravity</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the global gravity vector. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae50c318304546c9cc066ee382668c4a1"></a><!-- doxytag: member="b2World::IsLocked" ref="ae50c318304546c9cc066ee382668c4a1" args="() const " -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#ae50c318304546c9cc066ee382668c4a1">IsLocked</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Is the world locked (in the middle of a time step). <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa2bced28ddef5bbb00ed5666e5e9f620"></a><!-- doxytag: member="b2World::SetAutoClearForces" ref="aa2bced28ddef5bbb00ed5666e5e9f620" args="(bool flag)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#aa2bced28ddef5bbb00ed5666e5e9f620">SetAutoClearForces</a> (bool flag)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set flag to control automatic clearing of forces after each time step. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af56cc43ebde27946ed39382b4ea31640"></a><!-- doxytag: member="b2World::GetAutoClearForces" ref="af56cc43ebde27946ed39382b4ea31640" args="() const " -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#af56cc43ebde27946ed39382b4ea31640">GetAutoClearForces</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the flag that controls automatic clearing of forces after each time step. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a16259159ae1719c30808561c990a8c05"></a><!-- doxytag: member="b2World::GetContactManager" ref="a16259159ae1719c30808561c990a8c05" args="() const " -->
const <a class="el" href="classb2_contact_manager.html">b2ContactManager</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a16259159ae1719c30808561c990a8c05">GetContactManager</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the contact manager for testing. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af41b3f1a21efc854b485d311911e24b2"></a><!-- doxytag: member="b2World::GetProfile" ref="af41b3f1a21efc854b485d311911e24b2" args="() const " -->
const <a class="el" href="structb2_profile.html">b2Profile</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#af41b3f1a21efc854b485d311911e24b2">GetProfile</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the current profile. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_world.html#a73c1fec260d460514edd335d4c235893">Dump</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="friends"></a>
Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a010ab52de250e5fe30a45d642f46405b"></a><!-- doxytag: member="b2World::b2Body" ref="a010ab52de250e5fe30a45d642f46405b" args="" -->
class&#160;</td><td class="memItemRight" valign="bottom"><b>b2Body</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afb35b0e61f6ee3cc516c40ea251f3236"></a><!-- doxytag: member="b2World::b2Fixture" ref="afb35b0e61f6ee3cc516c40ea251f3236" args="" -->
class&#160;</td><td class="memItemRight" valign="bottom"><b>b2Fixture</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aece264d42f69aed410f5eb3beba6ddf2"></a><!-- doxytag: member="b2World::b2ContactManager" ref="aece264d42f69aed410f5eb3beba6ddf2" args="" -->
class&#160;</td><td class="memItemRight" valign="bottom"><b>b2ContactManager</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad0171f9dac44cc7aae065c618c0d165b"></a><!-- doxytag: member="b2World::b2Controller" ref="ad0171f9dac44cc7aae065c618c0d165b" args="" -->
class&#160;</td><td class="memItemRight" valign="bottom"><b>b2Controller</b></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>The world class manages all physics entities, dynamic simulation, and asynchronous queries. The world also contains efficient memory management facilities. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aeccc87fd9e36702c821a8244ca7cd875"></a><!-- doxytag: member="b2World::b2World" ref="aeccc87fd9e36702c821a8244ca7cd875" args="(const b2Vec2 &amp;gravity)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">b2World::b2World </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structb2_vec2.html">b2Vec2</a> &amp;&#160;</td>
          <td class="paramname"><em>gravity</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Construct a world object. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">gravity</td><td>the world gravity vector. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ac082ab4c4ad0b1c5ec4674315eeec643"></a><!-- doxytag: member="b2World::ClearForces" ref="ac082ab4c4ad0b1c5ec4674315eeec643" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void b2World::ClearForces </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Manually clear the force buffer on all bodies. By default, forces are cleared automatically after each call to Step. The default behavior is modified by calling SetAutoClearForces. The purpose of this function is to support sub-stepping. Sub-stepping is often used to maintain a fixed sized time step under a variable frame-rate. When you perform sub-stepping you will disable auto clearing of forces and instead call ClearForces after all sub-steps are complete in one pass of your game loop. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classb2_world.html#aa2bced28ddef5bbb00ed5666e5e9f620" title="Set flag to control automatic clearing of forces after each time step.">SetAutoClearForces</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a2eb36e967e43294bfa03ec3d177c2dae"></a><!-- doxytag: member="b2World::CreateBody" ref="a2eb36e967e43294bfa03ec3d177c2dae" args="(const b2BodyDef *def)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classb2_body.html">b2Body</a> * b2World::CreateBody </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structb2_body_def.html">b2BodyDef</a> *&#160;</td>
          <td class="paramname"><em>def</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Create a rigid body given a definition. No reference to the definition is retained. </p>
<dl class="warning"><dt><b>Warning:</b></dt><dd>This function is locked during callbacks. </dd></dl>

</div>
</div>
<a class="anchor" id="a5cba9d0653149eb62504154e6fb35021"></a><!-- doxytag: member="b2World::CreateJoint" ref="a5cba9d0653149eb62504154e6fb35021" args="(const b2JointDef *def)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classb2_joint.html">b2Joint</a> * b2World::CreateJoint </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structb2_joint_def.html">b2JointDef</a> *&#160;</td>
          <td class="paramname"><em>def</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Create a joint to constrain bodies together. No reference to the definition is retained. This may cause the connected bodies to cease colliding. </p>
<dl class="warning"><dt><b>Warning:</b></dt><dd>This function is locked during callbacks. </dd></dl>

</div>
</div>
<a class="anchor" id="ad52231ad7a9556ef5735ac79cbcd8fcf"></a><!-- doxytag: member="b2World::DestroyBody" ref="ad52231ad7a9556ef5735ac79cbcd8fcf" args="(b2Body *body)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void b2World::DestroyBody </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classb2_body.html">b2Body</a> *&#160;</td>
          <td class="paramname"><em>body</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Destroy a rigid body given a definition. No reference to the definition is retained. This function is locked during callbacks. </p>
<dl class="warning"><dt><b>Warning:</b></dt><dd>This automatically deletes all associated shapes and joints. </dd>
<dd>
This function is locked during callbacks. </dd></dl>

</div>
</div>
<a class="anchor" id="add5942aef171e54cfa384c8975746dca"></a><!-- doxytag: member="b2World::DestroyJoint" ref="add5942aef171e54cfa384c8975746dca" args="(b2Joint *joint)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void b2World::DestroyJoint </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classb2_joint.html">b2Joint</a> *&#160;</td>
          <td class="paramname"><em>joint</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Destroy a joint. This may cause the connected bodies to begin colliding. </p>
<dl class="warning"><dt><b>Warning:</b></dt><dd>This function is locked during callbacks. </dd></dl>

</div>
</div>
<a class="anchor" id="a73c1fec260d460514edd335d4c235893"></a><!-- doxytag: member="b2World::Dump" ref="a73c1fec260d460514edd335d4c235893" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void b2World::Dump </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Dump the world into the log file. </p>
<dl class="warning"><dt><b>Warning:</b></dt><dd>this should be called outside of a time step. </dd></dl>

</div>
</div>
<a class="anchor" id="a1b87c03955e3312d308ddf679adf3c85"></a><!-- doxytag: member="b2World::GetBodyList" ref="a1b87c03955e3312d308ddf679adf3c85" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classb2_body.html">b2Body</a> * b2World::GetBodyList </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Get the world body list. With the returned body, use <a class="el" href="classb2_body.html#ad54182a11d02362b027a0eb072775bdc" title="Get the next body in the world&#39;s body list.">b2Body::GetNext</a> to get the next body in the world list. A NULL body indicates the end of the list. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the head of the world body list. </dd></dl>

</div>
</div>
<a class="anchor" id="ab1e1c59fd7534c0268c2a3e31370a425"></a><!-- doxytag: member="b2World::GetContactList" ref="ab1e1c59fd7534c0268c2a3e31370a425" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classb2_contact.html">b2Contact</a> * b2World::GetContactList </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Get the world contact list. With the returned contact, use <a class="el" href="classb2_contact.html#aebfebb1e4b27dc0bd7aa120093e3d650" title="Get the next contact in the world&#39;s contact list.">b2Contact::GetNext</a> to get the next contact in the world list. A NULL contact indicates the end of the list. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the head of the world contact list. </dd></dl>
<dl class="warning"><dt><b>Warning:</b></dt><dd>contacts are created and destroyed in the middle of a time step. Use <a class="el" href="classb2_contact_listener.html">b2ContactListener</a> to avoid missing contacts. </dd></dl>

</div>
</div>
<a class="anchor" id="a55db7240f8290aa02cab79f181934de8"></a><!-- doxytag: member="b2World::GetJointList" ref="a55db7240f8290aa02cab79f181934de8" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classb2_joint.html">b2Joint</a> * b2World::GetJointList </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Get the world joint list. With the returned joint, use <a class="el" href="classb2_joint.html#a1a0e2137b631010750c728cb4e276e5d" title="Get the next joint the world joint list.">b2Joint::GetNext</a> to get the next joint in the world list. A NULL joint indicates the end of the list. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the head of the world joint list. </dd></dl>

</div>
</div>
<a class="anchor" id="a0e9dceab7052fd6e0d73d6024cca1bcb"></a><!-- doxytag: member="b2World::GetTreeQuality" ref="a0e9dceab7052fd6e0d73d6024cca1bcb" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float32 b2World::GetTreeQuality </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Get the quality metric of the dynamic tree. The smaller the better. The minimum is 1. </p>

</div>
</div>
<a class="anchor" id="a711e55d2c6e68400f93472f807c3775b"></a><!-- doxytag: member="b2World::QueryAABB" ref="a711e55d2c6e68400f93472f807c3775b" args="(b2QueryCallback *callback, const b2AABB &amp;aabb) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void b2World::QueryAABB </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classb2_query_callback.html">b2QueryCallback</a> *&#160;</td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structb2_a_a_b_b.html">b2AABB</a> &amp;&#160;</td>
          <td class="paramname"><em>aabb</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Query the world for all fixtures that potentially overlap the provided AABB. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">callback</td><td>a user implemented callback class. </td></tr>
    <tr><td class="paramname">aabb</td><td>the query box. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ad902548be84df9cc36eced0f4c89ab0a"></a><!-- doxytag: member="b2World::RayCast" ref="ad902548be84df9cc36eced0f4c89ab0a" args="(b2RayCastCallback *callback, const b2Vec2 &amp;point1, const b2Vec2 &amp;point2) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void b2World::RayCast </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classb2_ray_cast_callback.html">b2RayCastCallback</a> *&#160;</td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structb2_vec2.html">b2Vec2</a> &amp;&#160;</td>
          <td class="paramname"><em>point1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structb2_vec2.html">b2Vec2</a> &amp;&#160;</td>
          <td class="paramname"><em>point2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Ray-cast the world for all fixtures in the path of the ray. Your callback controls whether you get the closest point, any point, or n-points. The ray-cast ignores shapes that contain the starting point. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">callback</td><td>a user implemented callback class. </td></tr>
    <tr><td class="paramname">point1</td><td>the ray starting point </td></tr>
    <tr><td class="paramname">point2</td><td>the ray ending point </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a85e6e1e911c7d6366f8c7d57a12b72ff"></a><!-- doxytag: member="b2World::SetContactFilter" ref="a85e6e1e911c7d6366f8c7d57a12b72ff" args="(b2ContactFilter *filter)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void b2World::SetContactFilter </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classb2_contact_filter.html">b2ContactFilter</a> *&#160;</td>
          <td class="paramname"><em>filter</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Register a contact filter to provide specific control over collision. Otherwise the default filter is used (b2_defaultFilter). The listener is owned by you and must remain in scope. </p>

</div>
</div>
<a class="anchor" id="a614549967fb8a1584b61c11e2d553d42"></a><!-- doxytag: member="b2World::SetContactListener" ref="a614549967fb8a1584b61c11e2d553d42" args="(b2ContactListener *listener)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void b2World::SetContactListener </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classb2_contact_listener.html">b2ContactListener</a> *&#160;</td>
          <td class="paramname"><em>listener</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Register a contact event listener. The listener is owned by you and must remain in scope. </p>

</div>
</div>
<a class="anchor" id="a6976d2c67400df03c0d44174ffcfb7ee"></a><!-- doxytag: member="b2World::SetDebugDraw" ref="a6976d2c67400df03c0d44174ffcfb7ee" args="(b2Draw *debugDraw)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void b2World::SetDebugDraw </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classb2_draw.html">b2Draw</a> *&#160;</td>
          <td class="paramname"><em>debugDraw</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Register a routine for debug drawing. The debug draw functions are called inside with <a class="el" href="classb2_world.html#a293d9865e407fd463e168b0a29856acc" title="Call this to draw shapes and other debug draw data.">b2World::DrawDebugData</a> method. The debug draw object is owned by you and must remain in scope. </p>

</div>
</div>
<a class="anchor" id="ae377f2dd5512ada7d27f4ad3541c75bf"></a><!-- doxytag: member="b2World::SetDestructionListener" ref="ae377f2dd5512ada7d27f4ad3541c75bf" args="(b2DestructionListener *listener)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void b2World::SetDestructionListener </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classb2_destruction_listener.html">b2DestructionListener</a> *&#160;</td>
          <td class="paramname"><em>listener</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Register a destruction listener. The listener is owned by you and must remain in scope. </p>

</div>
</div>
<a class="anchor" id="a7a8eff61af98461f978fe43f3af7be90"></a><!-- doxytag: member="b2World::Step" ref="a7a8eff61af98461f978fe43f3af7be90" args="(float32 timeStep, int32 velocityIterations, int32 positionIterations)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void b2World::Step </td>
          <td>(</td>
          <td class="paramtype">float32&#160;</td>
          <td class="paramname"><em>timeStep</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32&#160;</td>
          <td class="paramname"><em>velocityIterations</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32&#160;</td>
          <td class="paramname"><em>positionIterations</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Take a time step. This performs collision detection, integration, and constraint solution. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">timeStep</td><td>the amount of time to simulate, this should not vary. </td></tr>
    <tr><td class="paramname">velocityIterations</td><td>for the velocity constraint solver. </td></tr>
    <tr><td class="paramname">positionIterations</td><td>for the position constraint solver. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="b2_world_8h_source.html">b2World.h</a></li>
<li>b2World.cpp</li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Sat Sep 17 2011 17:35:56 for Box2D by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
